Linear-Time Ranking of Permutations
نویسندگان
چکیده
A lexicographic ranking function for the set of all permutations of n ordered symbols translates permutations to their ranks in the lexicographic order of all permutations. This is frequently used for indexing data structures by permutations. We present algorithms for computing both the ranking function and its inverse using O(n) arithmetic operations.
منابع مشابه
Ranking and unranking permutations in linear time
A ranking function for the permutations on n symbols assigns a unique integer in the range [0, n! − 1] to each of the n! permutations. The corresponding unranking function is the inverse: given an integer between 0 and n! − 1, the value of the function is the permutation having this rank. We present simple ranking and unranking algorithms for permutations that can be computed using O(n) arithme...
متن کاملEfficient Algorithms to Rank and Unrank Permutations in Lexicographic Order
We present uniform and non-uniform algorithms to rank and unrank permutations in lexicographic order. The uniform algorithms run in O(n log n) time and outperform Knuth’s ranking algorithm in all the experiments, and also the lineartime non-lexicographic algorithm of Myrvold-Ruskey for permutations up to size 128. The non-uniform algorithms generalize Korf-Schultze’s linear time algorithm yet r...
متن کاملPermutation Models for Collaborative Ranking
We study the problem of collaborative filtering where ranking information is available. Focusing on the core of the collaborative ranking process, the user and their community, we propose new models for representation of the underlying permutations and prediction of ranks. The first approach is based on the assumption that the user makes successive choice of items in a stage-wise manner. In par...
متن کاملConsensus Ranking with Signed Permutations
Signed permutations (also known as the hyperoctahedral group) are used in modeling genome rearrangements. The algorithmic problems they raise are computationally demanding when not NP-hard. This paper presents a tractable algorithm for learning consensus ranking between signed permutations under the inversion distance. This can be extended to estimate a natural class of exponential models over ...
متن کاملA Stream Cipher Based on Chaotic Permutations
In this paper we introduce a word-based stream cipher consisting of a chaotic part operating as a chaotic permutation and a linear part, both of which designed on a finite field. We will show that this system can operate in both synchronized and self-synchronized modes. More specifically, we show that in the self-synchronized mode the stream cipher has a receiver operating as an unknown input o...
متن کامل